// Replication file for "Why accommodate? How niche pressure and intra-party divisions shape mainstream party strategies
// Author: Felix Lehmann, Department of Political Science, University of Gothenburg, Gothenburg, Sweden

// Instructions on reproduction of the results
// For replication purposes, all lines that contain "C:\Users..." should be replaced with the appropriate file path or dataset to facilitate replication

// load the data file
// replace with the appropriate path
use "C:\Users...", replace

// redirect the working directory to where you want to export the figures to
// copy the desired path here
cd "C:\Users..."

// Figure 3
// breaking divisions down by party family
set scheme s1mono
graph bar (mean) eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, over(family, sort(eu_dissent_lag) descending) ytitle("mean EU intra-party divisions (t-1)") 
graph export fig3_jepp.jpg, replace

// The code below replicates the substantive results for Figures 4 and 5, the figures themselves where created in R (see the R replication file)

set scheme s1mono
// H1a
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
margins, dydx(eurosceptic_niche_narrow_vote2) at(eu_dissent_lag=(0(1)8))
marginsplot, ytitle(Effect of niche party vote share on Δ EU position, size(small)) recast(line) ciopts(recast(rline) lpattern(dash)) title("") level(95) yline(0)

graph export H1a_jepp_stata.png, replace

set scheme s1mono
// H1b
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
margins, dydx(mean_eu_sal_scep_niche_nar_lag) at(eu_dissent_lag=(0(1)8))
marginsplot, ytitle(Effect of niche party EU salience (t-1) on Δ EU position, size(small)) recast(line) ciopts(recast(rline) lpattern(dash)) title("") level(95) yline(0)

graph export H1b_jepp_stata.png, replace

set scheme s1mono
// H2a
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
margins, dydx(eurosceptic_niche_narrow_vote2) at(eu_dissent_lag=(0(1)8))
marginsplot, ytitle(Effect of niche party vote share on Δ EU salience, size(small)) recast(line) ciopts(recast(rline) lpattern(dash)) title("") level(95) yline(0)

graph export H2a_jepp_stata.png, replace

set scheme s1mono
// H2b
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
margins, dydx(mean_eu_sal_scep_niche_nar_lag) at(eu_dissent_lag=(0(1)8))
marginsplot, ytitle(Effect of niche party EU salience (t-1) on Δ EU salience, size(small)) recast(line) ciopts(recast(rline) lpattern(dash)) title("") level(95) yline(0)

graph export H2b_jepp_stata.png, replace


// Appendix
// descriptives for Table A1
asdoc sum eu_position_change eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, label replace dec(3)

// Distribution of main DVs/IVs for Figures A1-A5
hist eu_position_change if mainstream2 == 1 & eastwest == 1 & year >= 1999
graph export figA1_jepp.png, replace
hist eu_salience_change if mainstream2 == 1 & eastwest == 1 & year >= 1999
graph export figA2_jepp.png, replace
hist eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999
graph export figA3_jepp.png, replace
hist eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999
graph export figA4_jepp.png, replace
hist mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999
graph export figA5_jepp.png, replace


// Full tables for main results in Table A3
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA3.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// additional analyses
// including Ray data for Table A4
xtset party_id year

eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA4.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// mainstream left-right difference for Table A5 and A6
// only left parties (A5)
xtset party_id year
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA5.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// only right (A6)
xtset party_id year
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA6.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// Eurosceptic left and right separate for Table A7
xtset party_id year
eststo clear
eststo: xtreg eu_position_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_rl_eu_sal_scep_ni_nar_lag c.eu_dissent_lag#c.mean_rr_eu_sal_scep_ni_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_rl_eu_sal_scep_ni_nar_lag c.eu_dissent_lag#c.mean_rr_eu_sal_scep_ni_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA7.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// hard and soft Eurosceptics separate for Table A8
xtset party_id year
eststo clear
eststo: xtreg eu_position_change soft_eurosceptic_niche_nar_vote2 hard_eurosceptic_niche_nar_vote2 mean_soft_eu_sal_scep_ni_nar_l mean_hard_eu_sal_scep_ni_nar_l eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.soft_eurosceptic_niche_nar_vote2 c.eu_dissent_lag#c.hard_eurosceptic_niche_nar_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change soft_eurosceptic_niche_nar_vote2 hard_eurosceptic_niche_nar_vote2 mean_soft_eu_sal_scep_ni_nar_l mean_hard_eu_sal_scep_ni_nar_l eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_soft_eu_sal_scep_ni_nar_l c.eu_dissent_lag#c.mean_hard_eu_sal_scep_ni_nar_l if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change soft_eurosceptic_niche_nar_vote2 hard_eurosceptic_niche_nar_vote2 mean_soft_eu_sal_scep_ni_nar_l mean_hard_eu_sal_scep_ni_nar_l eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.soft_eurosceptic_niche_nar_vote2 c.eu_dissent_lag#c.hard_eurosceptic_niche_nar_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change soft_eurosceptic_niche_nar_vote2 hard_eurosceptic_niche_nar_vote2 mean_soft_eu_sal_scep_ni_nar_l mean_hard_eu_sal_scep_ni_nar_l eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_soft_eu_sal_scep_ni_nar_l c.eu_dissent_lag#c.mean_hard_eu_sal_scep_ni_nar_l if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA8.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)


// mainstream left vs. Eurosceptic RL for Table A9

xtset party_id year
eststo clear
eststo: xtreg eu_position_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_rl_eu_sal_scep_ni_nar_lag c.eu_dissent_lag#c.mean_rr_eu_sal_scep_ni_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_rl_eu_sal_scep_ni_nar_lag c.eu_dissent_lag#c.mean_rr_eu_sal_scep_ni_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & left_party == 1, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA9.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// mainstream right vs. Eurosceptic RR

xtset party_id year
eststo clear
eststo: xtreg eu_position_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_rl_eu_sal_scep_ni_nar_lag c.eu_dissent_lag#c.mean_rr_eu_sal_scep_ni_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_rl_eu_sal_scep_ni_nar_lag c.eu_dissent_lag#c.mean_rr_eu_sal_scep_ni_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & right_party == 1, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA10.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// three-way interaction term
xtset party_id year
eststo clear
eststo: xtreg eu_position_change party_lr2 rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.party_lr2#c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag c.party_lr2#c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change party_lr2 rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag c.party_lr2#c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag c.party_lr2#c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change party_lr2 rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.party_lr2#c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag c.party_lr2#c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change party_lr2 rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.party_lr2#c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rl_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag c.party_lr2#c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.eu_dissent_lag#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.rr_sceptic_niche_nar_fam_vote2 c.party_lr2#c.eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA11.rtf, replace label varwidth(34) se compress nogap onecell modelwidth(5) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(rl_sceptic_niche_nar_fam_vote2 rr_sceptic_niche_nar_fam_vote2 mean_rl_eu_sal_scep_ni_nar_lag mean_rr_eu_sal_scep_ni_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 party_lr2)

// robustness checks

// visualization for Figure A6
// simplify label titles for better visualization
label variable eu_dissent_lag "EU intra-party divisions"
label variable eurosceptic_niche_narrow_vote2 "Eurosceptic vote"
label variable mean_eu_sal_scep_niche_nar_lag "Eurosceptic EU salience"
// interaction 1
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store alt_main
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store challenger
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store year_FEs
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store contentious
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag distance_avg_supp_eu_lag eu_position_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store add_controls
eststo: xtreg eu_position_change eu_position_lag eu_salience_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store lag

set scheme s1mono
coefplot full alt_main challenger year_FEs contentious add_controls lag, bylabel(Δ EU position) ||, yline(0) keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(1)) levels(95 90) vertical title("Δ EU position (H1a)")

graph save FigureA6_1_jepp, replace

// interaction 2
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store fullb
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store alt_mainb
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store challengerb
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store year_FEsb
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store contentiousb
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag distance_avg_supp_eu_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store add_controlsb
eststo: xtreg eu_position_change eu_position_lag eu_salience_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store lagb

set scheme s1mono
coefplot fullb alt_mainb challengerb year_FEsb contentiousb add_controlsb lagb, bylabel(Δ EU position) ||, yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(1)) levels(95 90) vertical title("Δ EU position (H1b)")

graph save FigureA6_2_jepp, replace

// interaction 3
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store fullc
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store alt_mainc
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store challengerc
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store year_FEsc
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store contentiousc
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag distance_avg_supp_eu_lag eu_salience_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store add_controlsc
eststo: xtreg eu_salience_change eu_salience_lag eu_position_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag government vote eu_dissent_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store lagc

set scheme s1mono
coefplot fullc alt_mainc challengerc year_FEsc contentiousc add_controlsc lagc, bylabel(Δ EU salience) ||, yline(0) keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(1)) levels(95 90) vertical title("Δ EU salience (H2a)")

graph save FigureA6_3_jepp, replace

// interaction 4
eststo clear
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store fulld
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store alt_maind
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store challengerd
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store year_FEsd
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store contentiousd
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag distance_avg_supp_eu_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store add_controlsd
eststo: xtreg eu_salience_change eu_salience_lag eu_position_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag government vote eu_dissent_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store lagd

set scheme s1mono
coefplot fulld alt_maind challengerd year_FEsd contentiousd add_controlsd lagd, bylabel(Δ EU salience) ||, yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(1)) levels(95 90) vertical title("Δ EU salience (H2b)")

graph save FigureA6_4_jepp, replace

grc1leg2 "FigureA6_1_jepp" "FigureA6_2_jepp" "FigureA6_3_jepp" "FigureA6_4_jepp", labsize(medsmall)
graph export FigureA6_jepp.png, replace

// change back labels
label variable eu_dissent_lag "EU intra-party divisions (t-1)"
label variable eurosceptic_niche_narrow_vote2 "Eurosceptic niche vote"
label variable mean_eu_sal_scep_niche_nar_lag "Eurosceptic niche EU salience (t-1)"


// alternative mainstream party definition for Table A12
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag  if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2  if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag  if mainstream_narrow == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA12.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// alternative niche party definition - challenger for Table A13
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag  if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2  if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag  if mainstream3 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA13.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2)

// year FEs for Table A14
xtset party_id year

eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
estadd local year "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
estadd local year "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
estadd local year "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag i.year if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
estadd local year "Yes"

esttab using TableA14.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party year, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs" "Year FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Two-way fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2) keep(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag)


// explicitly modelling the time variables (Lisbon, Eurozone crisis) for Table A15
xtset party_id year

eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag eurocrisis lisbon_treaty if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA15.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party , fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag eurocrisis lisbon_treaty c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) keep(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag eurocrisis lisbon_treaty c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag)

// additional control variables for Table A16
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag distance_avg_supp_eu_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag distance_avg_supp_eu_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag abs_distance_avg_supp_eu_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag abs_lr_distance_lag2 abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag avg_supporter_eu_diss_lag abs_distance_avg_supp_eu_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA16.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag abs_distance_mean_eu_pos_lag vote_change o_mean_main_nar_eu_sal_lag)

// lagged variables for Table A17
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eu_position_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_position_change eu_position_lag eu_salience_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eu_salience_lag eu_position_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag government vote eu_dissent_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change eu_salience_lag eu_position_lag eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag government vote eu_dissent_lag abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA17.rtf, replace label varwidth(30) se compress nogap onecell modelwidth(6) stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag abs_eu_distance_lag2 eu_position_lag eu_salience_lag)

// Table A18 includes manifesto data that changes the structure of the dataset
// add manifesto data

// manipulate CHES dataset to enable merging with CMP data
gen ches_year = year

// change working directory to location of the CMP data file
cd "C:\Users\..."

// prepare supplied CMP dataset for merging with CHES data
drop if cmp_id == .
drop if country == 31 & cmp_id == 81713 

// merge with CMP data
merge 1:m ches_year cmp_id using "why accommodate_data_cmp.dta", keepusing(eu_salience_cmp eu_salience_change_cmp eu_position_cmp eu_position_change_cmp eu_position_cmp_old eu_position_change_cmp_old electiondate) gen(cmp)
drop if country == .
drop if cmp != 3

label variable eu_dissent "EU intra-party divisions"

xtset party_id electiondate
// Table A18
eststo clear
eststo: xtreg eu_salience_change_cmp eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent government vote abs_eu_distance_lag2 c.eu_dissent#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"
eststo: xtreg eu_salience_change_cmp eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent government vote abs_eu_distance_lag2 c.eu_dissent#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estadd local party "Yes"

esttab using TableA18.rtf, replace label varwidth(34) modelwidth(5) compress nogap onecell se stats(r2 N N_clust party, fmt(a2) label ("R²" "Observations" "Number of mainstream parties" "Party FEs")) star (+ 0.1 * 0.05 ** 0.01 *** 0.001) nonumbers mtitles("Δ EU position" "Δ EU position" "Δ EU salience"  "Δ EU salience") note("Notes: Fixed effects regression models with robust standard errors clustered by mainstream party in parentheses") b(%9.3fc) order(eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent government vote abs_eu_distance_lag2)

// switch back to initial data file with the appropriate data structure for analyzing CHES data
use "C:\Users...", replace
// redirect the working directory to where you want to export the figures to
cd "C:\Users..."

// jackknife analyses
// simplify label titles for better visualization
label variable eu_dissent_lag "EU intra-party divisions"
label variable eurosceptic_niche_narrow_vote2 "Eurosceptic vote"
label variable mean_eu_sal_scep_niche_nar_lag "Eurosceptic EU salience"

// dropping one control variable at a time for Figure A7
xtset party_id year
eststo clear
// interaction 1
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_eudistance
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_vote
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_government

set scheme s1mono
coefplot full no_eudistance no_vote no_government, bylabel(Δ EU position)  || , yline(0) keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(1)) byopts(yrescale) levels(95 90) vertical title("Δ EU position (H1a)")

graph save jack_v1, replace

eststo clear
// interaction 2
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_eudistance
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_vote
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_government

set scheme s1mono
coefplot full no_eudistance no_vote no_government, bylabel(Δ EU position)  || , yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(1)) byopts(yrescale) levels(95 90) vertical title("Δ EU position (H1b)")

graph save jack_v2, replace

eststo clear
// interaction 3
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_eudistance
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_vote
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_government

set scheme s1mono
coefplot full no_eudistance no_vote no_government, bylabel(Δ EU salience)  || ,  keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(1)) byopts(yrescale) levels(95 90) vertical title("Δ EU salience (H2a)")

graph save jack_v3, replace

eststo clear
// interaction 4
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_eudistance
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_vote
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store no_government

set scheme s1mono
coefplot full no_eudistance no_vote no_government, bylabel(Δ EU salience)  || , keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(1)) byopts(yrescale) levels(95 90) vertical title("Δ EU salience (H2b)")

graph save jack_v4, replace


grc1leg2 "jack_v1" "jack_v2" "jack_v3" "jack_v4", labsize(medsmall)
graph export FigureA7_jepp.png, replace

// drop waves for Figure A8
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 5, fe cluster(party_id)
estimate store no1999
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 6, fe cluster(party_id)
estimate store no2002
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 7, fe cluster(party_id)
estimate store no2006
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 8, fe cluster(party_id)
estimate store no2010
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 9, fe cluster(party_id)
estimate store no2014
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 10, fe cluster(party_id)
estimate store no2019

set scheme s1mono
coefplot full no1999 no2002 no2006 no2010 no2014 no2019, bylabel(Δ EU position)  || , yline(0) keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(1)) byopts(xrescale) levels(95 90) vertical title("Δ EU position (H1a)")

graph save jack_y1, replace
// drop waves
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 5, fe cluster(party_id)
estimate store no1999
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 6, fe cluster(party_id)
estimate store no2002
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 7, fe cluster(party_id)
estimate store no2006
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 8, fe cluster(party_id)
estimate store no2010
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 9, fe cluster(party_id)
estimate store no2014
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 10, fe cluster(party_id)
estimate store no2019


set scheme s1mono
coefplot full no1999 no2002 no2006 no2010 no2014 no2019, bylabel(Δ EU position)  || , yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(1)) byopts(xrescale) levels(95 90) vertical title("Δ EU position (H1b)")

graph save jack_y2, replace
// drop waves
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 5, fe cluster(party_id)
estimate store no1999
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 6, fe cluster(party_id)
estimate store no2002
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 7, fe cluster(party_id)
estimate store no2006
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 8, fe cluster(party_id)
estimate store no2010
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 9, fe cluster(party_id)
estimate store no2014
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 10, fe cluster(party_id)
estimate store no2019

set scheme s1mono
coefplot full no1999 no2002 no2006 no2010 no2014 no2019, bylabel(Δ EU salience)  || , yline(0) keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(1)) byopts(xrescale) levels(95 90) vertical title("Δ EU salience (H2a)")

graph save jack_y3, replace
// drop waves
xtset party_id year
// full model
eststo clear
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 5, fe cluster(party_id)
estimate store no1999
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 6, fe cluster(party_id)
estimate store no2002
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 7, fe cluster(party_id)
estimate store no2006
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 8, fe cluster(party_id)
estimate store no2010
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 9, fe cluster(party_id)
estimate store no2014
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999 & wave != 10, fe cluster(party_id)
estimate store no2019


set scheme s1mono
coefplot full no1999 no2002 no2006 no2010 no2014 no2019, bylabel(Δ EU salience)  || , yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(1)) byopts(xrescale) levels(95 90) vertical title("Δ EU salience (H2b)")

graph save jack_y4, replace


grc1leg2 "jack_y1" "jack_y2" "jack_y3" "jack_y4", labsize(medsmall)
graph export FigureA8_jepp.png, replace

// drop countries on by one for Figure A9

eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 1 & year >= 1999, fe cluster(party_id)
estimate store no_be
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 2 & year >= 1999, fe cluster(party_id)
estimate store no_dk
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 3 & year >= 1999, fe cluster(party_id)
estimate store no_ge
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 4 & year >= 1999, fe cluster(party_id)
estimate store no_gr
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 5 & year >= 1999, fe cluster(party_id)
estimate store no_esp
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 6 & year >= 1999, fe cluster(party_id)
estimate store no_fr
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 7 & year >= 1999, fe cluster(party_id)
estimate store no_irl
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 8 & year >= 1999, fe cluster(party_id)
estimate store no_it
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 10 & year >= 1999, fe cluster(party_id)
estimate store no_nl
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 11 & year >= 1999, fe cluster(party_id)
estimate store no_uk
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 12 & year >= 1999, fe cluster(party_id)
estimate store no_por
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 13 & year >= 1999, fe cluster(party_id)
estimate store no_aus
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 14 & year >= 1999, fe cluster(party_id)
estimate store no_fin
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 16 & year >= 1999, fe cluster(party_id)
estimate store no_sv

set scheme s1mono
coefplot full no_be no_dk no_ge no_gr no_esp no_fr no_irl no_it no_nl no_uk no_por no_aus no_fin no_sv, bylabel(Δ EU position)  || , yline(0) keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(2)) byopts(xrescale) levels(95 90) vertical title("Δ EU position (H1a)")

graph save jack_c1, replace

eststo clear
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 1 & year >= 1999, fe cluster(party_id)
estimate store no_be
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 2 & year >= 1999, fe cluster(party_id)
estimate store no_dk
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 3 & year >= 1999, fe cluster(party_id)
estimate store no_ge
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 4 & year >= 1999, fe cluster(party_id)
estimate store no_gr
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 5 & year >= 1999, fe cluster(party_id)
estimate store no_esp
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 6 & year >= 1999, fe cluster(party_id)
estimate store no_fr
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 7 & year >= 1999, fe cluster(party_id)
estimate store no_irl
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 8 & year >= 1999, fe cluster(party_id)
estimate store no_it
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 10 & year >= 1999, fe cluster(party_id)
estimate store no_nl
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 11 & year >= 1999, fe cluster(party_id)
estimate store no_uk
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 12 & year >= 1999, fe cluster(party_id)
estimate store no_por
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 13 & year >= 1999, fe cluster(party_id)
estimate store no_aus
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 14 & year >= 1999, fe cluster(party_id)
estimate store no_fin
eststo: xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 16 & year >= 1999, fe cluster(party_id)
estimate store no_sv

set scheme s1mono
coefplot full no_be no_dk no_ge no_gr no_esp no_fr no_irl no_it no_nl no_uk no_por no_aus no_fin no_sv, bylabel(Δ EU position)  || , yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(2)) byopts(xrescale) levels(95 90) vertical title("Δ EU position (H1b)")

graph save jack_c2, replace


eststo clear
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 1 & year >= 1999, fe cluster(party_id)
estimate store no_be
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 2 & year >= 1999, fe cluster(party_id)
estimate store no_dk
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 3 & year >= 1999, fe cluster(party_id)
estimate store no_ge
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 4 & year >= 1999, fe cluster(party_id)
estimate store no_gr
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 5 & year >= 1999, fe cluster(party_id)
estimate store no_esp
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 6 & year >= 1999, fe cluster(party_id)
estimate store no_fr
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 7 & year >= 1999, fe cluster(party_id)
estimate store no_irl
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 8 & year >= 1999, fe cluster(party_id)
estimate store no_it
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 10 & year >= 1999, fe cluster(party_id)
estimate store no_nl
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 11 & year >= 1999, fe cluster(party_id)
estimate store no_uk
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 12 & year >= 1999, fe cluster(party_id)
estimate store no_por
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 13 & year >= 1999, fe cluster(party_id)
estimate store no_aus
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 14 & year >= 1999, fe cluster(party_id)
estimate store no_fin
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & country != 16 & year >= 1999, fe cluster(party_id)
estimate store no_sv

set scheme s1mono
coefplot full no_be no_dk no_ge no_gr no_esp no_fr no_irl no_it no_nl no_uk no_por no_aus no_fin no_sv, bylabel(Δ EU position)  || , keep(c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2) legend(pos(6) row(2)) byopts(xrescale) levels(95 90) vertical title("Δ EU salience (H2a)")

graph save jack_c3, replace

eststo clear
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
estimate store full
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 1 & year >= 1999, fe cluster(party_id)
estimate store no_be
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 2 & year >= 1999, fe cluster(party_id)
estimate store no_dk
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 3 & year >= 1999, fe cluster(party_id)
estimate store no_ge
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 4 & year >= 1999, fe cluster(party_id)
estimate store no_gr
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 5 & year >= 1999, fe cluster(party_id)
estimate store no_esp
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 6 & year >= 1999, fe cluster(party_id)
estimate store no_fr
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 7 & year >= 1999, fe cluster(party_id)
estimate store no_irl
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 8 & year >= 1999, fe cluster(party_id)
estimate store no_it
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 10 & year >= 1999, fe cluster(party_id)
estimate store no_nl
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 11 & year >= 1999, fe cluster(party_id)
estimate store no_uk
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 12 & year >= 1999, fe cluster(party_id)
estimate store no_por
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 13 & year >= 1999, fe cluster(party_id)
estimate store no_aus
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 14 & year >= 1999, fe cluster(party_id)
estimate store no_fin
eststo: xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & country != 16 & year >= 1999, fe cluster(party_id)
estimate store no_sv

set scheme s1mono
coefplot full no_be no_dk no_ge no_gr no_esp no_fr no_irl no_it no_nl no_uk no_por no_aus no_fin no_sv, bylabel(Δ EU salience)  || , yline(0) keep(c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag) legend(pos(6) row(2)) byopts(xrescale) levels(95 90) vertical title("Δ EU salience (H2b)")

graph save jack_c4, replace


grc1leg2 "jack_c1" "jack_c2" "jack_c3" "jack_c4", labsize(medsmall)
graph export FigureA9_jepp.png, replace

// change back labels
label variable eu_dissent_lag "EU intra-party divisions (t-1)"
label variable eurosceptic_niche_narrow_vote2 "Eurosceptic niche vote"
label variable mean_eu_sal_scep_niche_nar_lag "Eurosceptic niche EU salience (t-1)"


// model diagnostics

// pwcorr 
pwcorr eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999
pwcorr eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 if mainstream2 == 1 & eastwest == 1 & year >= 1999


xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
vif, unc
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
vif, unc
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
vif, unc
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
vif, unc


// testing for heteroscedasticity using a modified Wald statistic for groupwise heteroskedasticity --> evidence for groupwise heteroskedasticity at p = 0
xtset party_id wave
// full model
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
xttest3
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
xttest3
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
xttest3
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe cluster(party_id)
xttest3

// // testing for serial correlation using the Wooldridge test for serial correlation in panel data --> evidence for first-order autocorrelation

xtserial eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999

xtserial eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote abs_eu_distance_lag2 if mainstream2 == 1 & eastwest == 1 & year >= 1999

// Hausman test for fixed and random effects --> rejects the null at p < 0.05
xtset party_id year
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, re 
estimates store random
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe 
estimates store fixed

hausman fixed random, sigmamore

xtset party_id year
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, re 
estimates store random
xtreg eu_position_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe 
estimates store fixed

hausman fixed random, sigmamore

xtset party_id year
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, re 
estimates store random
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe 
estimates store fixed

hausman fixed random, sigmamore

xtset party_id year
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, re 
estimates store random
xtreg eu_salience_change eurosceptic_niche_narrow_vote2 mean_eu_sal_scep_niche_nar_lag eu_dissent_lag government vote eu_distance2_lag c.eu_dissent_lag#c.mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe 
estimates store fixed

hausman fixed random, sigmamore


// unit root testing
xtset party_id wave
xtunitroot fisher eu_salience_change if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher eu_position_change if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher eu_dissent_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher eurosceptic_niche_narrow_vote2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher mean_eu_sal_scep_niche_nar_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher government if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift 
xtunitroot fisher vote if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher abs_eu_distance_lag2 if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift
xtunitroot fisher eu_distance2_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, lags(1) dfuller demean drift

// testing for unit roots, no evidence of unit roots
xtset party_id year
xtreg eu_salience_change eu_salience_change_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg eu_position_change eu_position_change_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg eu_dissent_lag eu_dissent_lag_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg government government_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg vote vote_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg abs_eu_distance_lag2 abs_eu_distance_lag2_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg eu_distance2_lag abs_eu_distance_lag2_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg eurosceptic_niche_narrow_vote2 eurosceptic_ni_nar_vote2_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe
xtreg mean_eu_sal_scep_niche_nar_lag eurosceptic_ni_nar_vote2_lag_lag if mainstream2 == 1 & eastwest == 1 & year >= 1999, fe








